import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/rich-sparrow-god/login/userLogin',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    url: '/vue-admin-template/user/info',
    method: 'get',
    params: { token }
  })
}

export function logout() {
  return request({
    url: '/vue-admin-template/user/logout',
    method: 'post'
  })
}
/* ======================*/
export function pageStore(data) {
  return request({
    url: '/rich-sparrow-god/storeManager/pageStore',
    method: 'post',
    data
  })
}

// 房间列表
export function pageRoom(data) {
  return request({
    url: '/rich-sparrow-god/roomManager/pageRoom',
    method: 'post',
    data
  })
}

// 订单列表
export function pageOrder(data) {
  return request({
    url: '/rich-sparrow-god/adminOrder/getOrderPage',
    method: 'post',
    data
  })
}

// 同意退款
export function confirmBack(data) {
  return request({
    url: '/rich-sparrow-god/adminOrder/confirmBack',
    method: 'post',
    data
  })
}

// 文件上传
export function fileUpload(data) {
  return request({
    url: '/rich-sparrow-god/file/fileUpload',
    method: 'post',
    data
  })
}

// 新增店铺
export function addStore(data) {
  return request({
    url: '/rich-sparrow-god/storeManager/addStore',
    method: 'post',
    data
  })
}

// 新增房间
export function addRoom(data) {
  return request({
    url: '/rich-sparrow-god/roomManager/addRoom',
    method: 'post',
    data
  })
}

// 修改店铺
export function updateStore(data) {
  return request({
    url: '/rich-sparrow-god/storeManager/updateStore',
    method: 'post',
    data
  })
}

// 修改房间
export function updateRoom(data) {
  return request({
    url: '/rich-sparrow-god/roomManager/updateRoom',
    method: 'post',
    data
  })
}

// 删除店铺
export function delStore(data) {
  return request({
    url: '/rich-sparrow-god/storeManager/delStore',
    method: 'post',
    data
  })
}

// 删除房间
export function delRoom(data) {
  return request({
    url: '/rich-sparrow-god/roomManager/delRoom',
    method: 'post',
    data
  })
}

// 省市区字典
export function selectRegion(data) {
  return request({
    url: '/rich-sparrow-god/sys/selectRegion',
    // url: '/rich-sparrow-god/sys/tree',
    method: 'post',
    data
  })
}

// 新增美团套餐与房间关联
export function addMtMapping(data) {
  return request({
    url: '/rich-sparrow-god/roomManager/addMtMapping',
    method: 'post',
    data
  })
}

// 查询房间关联美团套餐列表
export function getMtMappingList(data) {
  return request({
    url: '/rich-sparrow-god/roomManager/getMtMappingList',
    method: 'post',
    data
  })
}

// 删除美团套餐与房间关联
export function delMtMapping(data) {
  return request({
    url: '/rich-sparrow-god/roomManager/delMtMapping',
    method: 'post',
    data
  })
}

// 修改美团套餐与房间关联
export function updateMtMapping(data) {
  return request({
    url: '/rich-sparrow-god/roomManager/updateMtMapping',
    method: 'post',
    data
  })
}

// 新增问题反馈选项
export function addFeedbackOptions(data) {
  return request({
    url: '/rich-sparrow-god/feedbackOptions/addFeedbackOptions',
    method: 'post',
    data
  })
}

// 查询问题反馈选项列表
export function getAllFeedbackOptionsList(data) {
  return request({
    url: '/rich-sparrow-god/feedbackOptions/getAllFeedbackOptionsList',
    method: 'post',
    data
  })
}

// 删除问题反馈选项
export function delFeedbackOptions(data) {
  return request({
    url: '/rich-sparrow-god/feedbackOptions/delFeedbackOptions',
    method: 'post',
    data
  })
}

// 修改问题反馈选项
export function updateFeedbackOptions(data) {
  return request({
    url: '/rich-sparrow-god/feedbackOptions/updateFeedbackOptions',
    method: 'post',
    data
  })
}

// 分页查询问题反馈
export function getProblemFeedbackPage(data) {
  return request({
    url: '/rich-sparrow-god/problemFeedback/getProblemFeedbackPage',
    method: 'post',
    data
  })
}

// 新增续电器
export function addRelays(data) {
  return request({
    url: '/rich-sparrow-god/relays/addRelays',
    method: 'post',
    data
  })
}

// 查询续电器列表(表格)
export function getRelaysList(data) {
  return request({
    url: '/rich-sparrow-god/relays/getRelaysList',
    method: 'post',
    data
  })
}

// 删除续电器
export function delRelays(data) {
  return request({
    url: '/rich-sparrow-god/relays/delRelays',
    method: 'post',
    data
  })
}

// 查询续电器通道
export function getChannelListByRelaysId(data) {
  return request({
    url: '/rich-sparrow-god/relays/getChannelListByRelaysId',
    method: 'post',
    data
  })
}

// 查询续电器列表(下拉)
export function getAllRelays(data) {
  return request({
    url: '/rich-sparrow-god/relays/getAllRelays',
    method: 'post',
    data
  })
}

// 通过续电器id查询通道
export function getRelaysChannel(data) {
  return request({
    url: '/rich-sparrow-god/relays/getRelaysChannel',
    method: 'post',
    data
  })
}

// 分页查询优惠券
export function getCouponPage(data) {
  return request({
    url: '/rich-sparrow-god/coupon/getCouponPage',
    method: 'post',
    data
  })
}

// 新增优惠券
export function addCoupon(data) {
  return request({
    url: '/rich-sparrow-god/coupon/addCoupon',
    method: 'post',
    data
  })
}

// 编辑优惠券
export function updateCoupon(data) {
  return request({
    url: '/rich-sparrow-god/coupon/updateCoupon',
    method: 'post',
    data
  })
}

// 删除优惠券
export function delCoupon(data) {
  return request({
    url: '/rich-sparrow-god/coupon/delCoupon',
    method: 'post',
    data
  })
}

// 查询优惠券列表
export function getCouponList(data) {
  return request({
    url: '/rich-sparrow-god/coupon/getCouponList',
    method: 'post',
    data
  })
}

// 新增发放优惠券
export function giveOutCoupon(data) {
  return request({
    url: '/rich-sparrow-god/coupon/giveOutCoupon',
    method: 'post',
    data
  })
}

// 分页查询发放优惠券
export function getGiveOutCouponPage(data) {
  return request({
    url: '/rich-sparrow-god/coupon/getGiveOutCouponPage',
    method: 'post',
    data
  })
}

// 取消发放优惠券
export function cancelGiveOutCoupon(data) {
  return request({
    url: '/rich-sparrow-god/coupon/cancelGiveOutCoupon',
    method: 'post',
    data
  })
}

// 查询房间类型列表
export function getRoomTypeList(data) {
  return request({
    url: '/rich-sparrow-god/roomManager/getRoomTypeList',
    method: 'post',
    data
  })
}

// 新增房间类型
export function addRoomType(data) {
  return request({
    url: '/rich-sparrow-god/roomManager/addRoomType',
    method: 'post',
    data
  })
}

// 编辑房间类型
export function updateRoomType(data) {
  return request({
    url: '/rich-sparrow-god/roomManager/updateRoomType',
    method: 'post',
    data
  })
}

// 删除房间类型
export function delRoomType(data) {
  return request({
    url: '/rich-sparrow-god/roomManager/delRoomType',
    method: 'post',
    data
  })
}

// 新增房间标签
export function addRoomLabel(data) {
  return request({
    url: '/rich-sparrow-god/roomManager/addRoomLabel',
    method: 'post',
    data
  })
}

// 编辑房间标签
export function updateRoomLabel(data) {
  return request({
    url: '/rich-sparrow-god/roomManager/updateRoomLabel',
    method: 'post',
    data
  })
}

// 查询房间标签列表
export function getAllRoomLabelList(data) {
  return request({
    url: '/rich-sparrow-god/roomManager/getAllRoomLabelList',
    method: 'post',
    data
  })
}

// 删除房间标签
export function delRoomLabel(data) {
  return request({
    url: '/rich-sparrow-god/roomManager/delRoomLabel',
    method: 'post',
    data
  })
}

// 分页查询角色
export function getSysRolePage(data) {
  return request({
    url: '/rich-sparrow-god/sysRole/getSysRolePage',
    method: 'post',
    data
  })
}

// 删除角色
export function delSysRole(data) {
  return request({
    url: '/rich-sparrow-god/sysRole/delSysRole',
    method: 'post',
    data
  })
}

// 新增角色
export function addSysRole(data) {
  return request({
    url: '/rich-sparrow-god/sysRole/addSysRole',
    method: 'post',
    data
  })
}

// 编辑角色
export function updateSysRole(data) {
  return request({
    url: '/rich-sparrow-god/sysRole/updateSysRole',
    method: 'post',
    data
  })
}

// 分页查询已保存手机号小程序用户
export function getAppletsUserPage(data) {
  return request({
    url: '/rich-sparrow-god/sysRole/getAppletsUserPage',
    method: 'post',
    data
  })
}

// 小程序用户关联角色
export function addSysRoleUser(data) {
  return request({
    url: '/rich-sparrow-god/sysRole/addSysRoleUser',
    method: 'post',
    data
  })
}

// 查询活动列表
export function getActivityList(data) {
  return request({
    url: '/rich-sparrow-god/activity/getActivityList',
    method: 'post',
    data
  })
}

// 删除活动
export function delActivity(data) {
  return request({
    url: '/rich-sparrow-god/activity/delActivity',
    method: 'post',
    data
  })
}

// 新增活动
export function addActivity(data) {
  return request({
    url: '/rich-sparrow-god/activity/addActivity',
    method: 'post',
    data
  })
}

// 编辑活动
export function updateActivity(data) {
  return request({
    url: '/rich-sparrow-god/activity/updateActivity',
    method: 'post',
    data
  })
}

// 查询客服列表
export function getCustomerServiceList(data) {
  return request({
    url: '/rich-sparrow-god/customerService/getCustomerServiceList',
    method: 'post',
    data
  })
}

// 删除客服
export function delCustomerService(data) {
  return request({
    url: '/rich-sparrow-god/customerService/delCustomerService',
    method: 'post',
    data
  })
}

// 新增客服
export function addCustomerService(data) {
  return request({
    url: '/rich-sparrow-god/customerService/addCustomerService',
    method: 'post',
    data
  })
}

// 编辑客服
export function updateCustomerService(data) {
  return request({
    url: '/rich-sparrow-god/customerService/updateCustomerService',
    method: 'post',
    data
  })
}

// 通过店铺id查询房间类型
export function getRoomTypeListByStore(data) {
  return request({
    url: '/rich-sparrow-god/storeManager/getRoomTypeListByStore',
    method: 'post',
    data
  })
}

// 生成房间小程序码
export function createAppletCode(data) {
  return request({
    url: '/rich-sparrow-god/roomManager/createAppletCode',
    method: 'post',
    data
  })
}

// 查询充值金额列表
export function getRechargeAmountList(data) {
  return request({
    url: '/rich-sparrow-god/rechargeAmount/getRechargeAmountList',
    method: 'post',
    data
  })
}

// 删除充值金额
export function delRechargeAmount(data) {
  return request({
    url: '/rich-sparrow-god/rechargeAmount/delRechargeAmount',
    method: 'post',
    data
  })
}

// 新增充值金额
export function addRechargeAmount(data) {
  return request({
    url: '/rich-sparrow-god/rechargeAmount/addRechargeAmount',
    method: 'post',
    data
  })
}

// 编辑充值金额
export function updateRechargeAmount(data) {
  return request({
    url: '/rich-sparrow-god/rechargeAmount/updateRechargeAmount',
    method: 'post',
    data
  })
}

// 分页查询后付订单
export function getAfterPayOrderAdminPage(data) {
  return request({
    url: '/rich-sparrow-god/adminOrder/getAfterPayOrderAdminPage',
    method: 'post',
    data
  })
}

// 查询后付店铺列表
export function getAfterPayStoreList(data) {
  return request({
    url: '/rich-sparrow-god/storeManager/getAfterPayStoreList',
    method: 'post',
    data
  })
}

// 后付订单流水
export function getAfterPayOrderFlow(data) {
  return request({
    url: '/rich-sparrow-god/adminOrder/getAfterPayOrderFlow',
    method: 'post',
    data
  })
}

// 新增商品类型
export function addGoodsType(data) {
  return request({
    url: '/rich-sparrow-god/goodsType/addGoodsType',
    method: 'post',
    data
  })
}

// 修改商品类型
export function updateGoodsType(data) {
  return request({
    url: '/rich-sparrow-god/goodsType/updateGoodsType',
    method: 'post',
    data
  })
}

// 分页查询商品类型
export function getGoodsTypePage(data) {
  return request({
    url: '/rich-sparrow-god/goodsType/getGoodsTypePage',
    method: 'post',
    data
  })
}

// 删除商品类型
export function delGoodsType(data) {
  return request({
    url: '/rich-sparrow-god/goodsType/delGoodsType',
    method: 'post',
    data
  })
}

// 查询商品类型
export function getGoodsTypeList(data) {
  return request({
    url: '/rich-sparrow-god/goodsAdmin/getGoodsTypeList',
    method: 'post',
    data
  })
}

// 新增商品
export function addGoods(data) {
  return request({
    url: '/rich-sparrow-god/goodsAdmin/addGoods',
    method: 'post',
    data
  })
}

// 修改商品
export function updateGoods(data) {
  return request({
    url: '/rich-sparrow-god/goodsAdmin/updateGoods',
    method: 'post',
    data
  })
}

// 分页查询商品
export function getGoodsPage(data) {
  return request({
    url: '/rich-sparrow-god/goodsAdmin/getGoodsPage',
    method: 'post',
    data
  })
}

// 删除商品
export function delGoods(data) {
  return request({
    url: '/rich-sparrow-god/goodsAdmin/delGoods',
    method: 'post',
    data
  })
}

// 更新商品库存
export function updateGoodsStock(data) {
  return request({
    url: '/rich-sparrow-god/goodsAdmin/updateGoodsStock',
    method: 'post',
    data
  })
}

// 商品上下架
export function putawayGoods(data) {
  return request({
    url: '/rich-sparrow-god/goodsAdmin/putawayGoods',
    method: 'post',
    data
  })
}

// 新增订单附加费
export function addOrderSurcharge(data) {
  return request({
    url: '/rich-sparrow-god/orderSurcharge/addOrderSurcharge',
    method: 'post',
    data
  })
}

// 修改订单附加费
export function updateOrderSurcharge(data) {
  return request({
    url: '/rich-sparrow-god/orderSurcharge/updateOrderSurcharge',
    method: 'post',
    data
  })
}

// 查询订单附加费
export function getOrderSurchargeList(data) {
  return request({
    url: '/rich-sparrow-god/orderSurcharge/getOrderSurchargeList',
    method: 'post',
    data
  })
}

// 删除订单附加费
export function delOrderSurcharge(data) {
  return request({
    url: '/rich-sparrow-god/orderSurcharge/delOrderSurcharge',
    method: 'post',
    data
  })
}

// 店铺绑定附加费
export function bindOrderSurcharge(data) {
  return request({
    url: '/rich-sparrow-god/storeManager/bindOrderSurcharge',
    method: 'post',
    data
  })
}